/*
 * com_cute4j_swing_SwingImage.cpp  0.4.0 / 2010-12-23
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#include "com_cute4j_swing_SwingImage.h"

#include "SwingImageDelegate.h"

/*
 * Native implementation for: com.cute4j.swing.SwingImage
 */

JNIEXPORT jlong JNICALL
Java_com_cute4j_swing_SwingImage__1create__
  (JNIEnv *env, jobject)
{
  return SwingImageDelegate::createImage(env);  // TODO: add obj if necessary
}

JNIEXPORT jlong JNICALL
Java_com_cute4j_swing_SwingImage__1create___3BI
  (JNIEnv *env, jobject obj, jbyteArray imageData, jint lenght)
{
  return SwingImageDelegate::createImage(env, obj, imageData, lenght);
}

JNIEXPORT jobject JNICALL
Java_com_cute4j_swing_SwingImage__1createScaled
  (JNIEnv *env, jobject, jlong imagePointer, jint width, jint height, jint hints, jstring format)
{
  return SwingImageDelegate::createScaled(env, imagePointer, width, height,
                                          hints, format);
}

JNIEXPORT void JNICALL
Java_com_cute4j_swing_SwingImage__1destroy
  (JNIEnv *, jobject, jlong imagePointer)
{
  delete SWING_IMAGE;
}


